﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net;
using System.IO;
using System.Reflection;

namespace time
{
    class Class_js1
    {
        public static void dowork()
        {
            
            Console.WriteLine(GetTemp());
        }


        private static string GetTemp()
        {

            System.Type type = System.Type.GetTypeFromProgID("MSScriptControl.ScriptControl");
            Object script = System.Activator.CreateInstance(type);
            type.InvokeMember("language", BindingFlags.SetProperty, null, script, new Object[] { "JavaScript" });
            type.InvokeMember("AddCode", BindingFlags.InvokeMethod, null, script, new Object[] { "function test(){ return new Date().getTime().toString(36)}" });

            return type.InvokeMember("Run", BindingFlags.InvokeMethod, null, script, new Object[] { "test" }).ToString();

        }

    }

           
}
